layui.config({
    base: CXL.ctxPath + '/externaljs/'
}).extend({ //设定组件别名
    echarts: 'echarts/echarts',
    axios: 'axios/axios',
    konva: 'konva/konva'
});
layui.use(['echarts','element', 'layer', 'carousel','konva'], function () {
    var element = layui.element;
    var $ = layui.$;
    var carousel = layui.carousel;
    // var echarts = layui.echarts;
    var konva = layui.konva;

    //点位信息量
    var cellMap = [];



    initPage();
    function initPage(){
        getCellMap();

    }


//获取所有的点
    function getCellMap() {
        $.ajax({
            url: '/boot/wms/cell/getCellMap',
            type: 'get',
            async: false,
            dataType: 'json',
            data:
                {
                    x1: 7400,
                    x2: 255000,
                    y1: 3200,
                    y2: 29200,

                },

            success: function (data) {
                cellMap = data.cellMap;

                console.log(cellMap);

                var scene = createScene(); //Call the createScene function

                // 最后一步调用engine的runRenderLoop方案，执行scene.render()，让我们的3d场景渲染起来
                engine.runRenderLoop(function () {
                    scene.render();
                });

                // 监听浏览器改变大小的事件，通过调用engine.resize()来自适应窗口大小
                window.addEventListener("resize", function () {
                    engine.resize();
                });

                // console.log(cellMap);
                // cellLocations = data.cellMap;

            }
        });
    }
});

